#Include <ScreenCapture.au3>
#Include <Function For Save As.au3>


AutoItSetOption("MustDeclareVars", 1)   ;Variables must be pre-declared.
Dim Const $sLogFileName =  "Save As2"   ;Log file named(Same with .au3 file name).

Common_WriteCurrentFunctionNameToTempTXT($sLogFileName)

CloseOpenedExcel($oExcel) 
;SaveAs_DocumentSaveAs()
SaveAs_DocumentSaveAs_1()
SaveAs_DocumentSaveAs_2()
SaveAs_DocumentSaveAs_3()
SaveAs_DocumentSaveAs_4()
SaveAs_DocumentSaveAs_5()
SaveAs_DocumentSaveAs_6()
SaveAs_DocumentSaveAs_7()
SaveAs_DocumentSaveAs_8()
SaveAs_DocumentSaveAs_9()
SaveAs_DocumentSaveAs_10()
SaveAs_DocumentSaveAs_11()
SaveAs_DocumentSaveAs_12()
SaveAs_DocumentSaveAs_13()
SaveAs_DocumentSaveAs_14()
SaveAs_DocumentSaveAs_15()
SaveAs_DocumentSaveAs_16()

Func SaveAs_DocumentSaveAs_1()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "DOCTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOC.doc', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOC.doc')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc
 
Func SaveAs_DocumentSaveAs_2()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "DOCXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOCX.docx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOCX.docx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc

Func SaveAs_DocumentSaveAs_3()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "RTFTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'RTF.rtf', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'RTF.rtf')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_4()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "DOCMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOCM.docm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOCM.docm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_5()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "XLSTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLS.xls', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLS.xls')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
EndFunc	

Func SaveAs_DocumentSaveAs_6()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "XLSXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLSX.xlsx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLSX.xlsx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_7()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "XLSMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLSM.xlsm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLSM.xlsm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_8()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "PPTTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPT.ppt', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPT.ppt')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_9()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "PPTXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPTX.pptx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPTX.pptx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_10()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "PPTMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPTM.pptm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPTM.pptm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_11()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "PPSTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPS.pps', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPS.pps')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_12()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "PPSXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPSX.ppsx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPSX.ppsx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_13()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "PPSMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPSM.ppsm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPSM.ppsm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	

Func SaveAs_DocumentSaveAs_14()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "XMLTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XML.xml', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XML.xml')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc

Func SaveAs_DocumentSaveAs_15()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)

	For $i = 0 to 13
		Local $TestCaseID = "TXTTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'TXT.TXT', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'TXT.TXT')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	
	
Func SaveAs_DocumentSaveAs_16()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)	

	For $i = 0 to 13
		Local $TestCaseID = "HTMLTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'HTML.htm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'HTML.htm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
EndFunc	


Func SaveAs_DocumentSaveAs()
	Common_Del_DB() 
	Common_InitializeStatus()   
	InitializeStatusForSaveAs()  
	Local $sPMTitle = Common_Run_PageManager() 
	Local $hPMHandle =  WinGetHandle($sPMTitle)
	ControlClick($hPMHandle, '', $sSwicthToListViewButtonCtrInfo)
	Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Local $hThumbnailView = ControlGetHandle($hPMHandle, "", $sThumbnailViewCtrInfo)
	
	For $i = 0 to 13
		Local $TestCaseID = "DOCTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOC.doc', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOC.doc')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
	
	For $i = 0 to 13
		Local $TestCaseID = "DOCXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOCX.docx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOCX.docx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next	
	
	For $i = 0 to 13
		Local $TestCaseID = "RTFTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'RTF.rtf', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'RTF.rtf')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "DOCMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'DOCM.docm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'DOCM.docm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "XLSTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLS.xls', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLS.xls')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "XLSXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLSX.xlsx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLSX.xlsx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "XLSMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XLSM.xlsm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XLSM.xlsm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPTTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPT.ppt', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPT.ppt')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPTXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPTX.pptx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPTX.pptx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPTMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPTM.pptm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPTM.pptm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPSTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPS.pps', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPS.pps')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPSXTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPSX.ppsx', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPSX.ppsx')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "PPSMTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'PPSM.ppsm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'PPSM.ppsm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "XMLTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'XML.xml', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'XML.xml')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "TXTTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'TXT.TXT', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'TXT.TXT')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	
	For $i = 0 to 13
		Local $TestCaseID = "HTMLTo" & $Saveto_1[$i]
		FileCopy($sSampleFolderPath &'HTML.htm', $sFunctionFolderPath, 1)
		Common_SleepTime(2)	
		Send('{F5}')
		Common_SleepTime(6)	
		WinActivate($hPMHandle)
		SelectOneFileInListiew()
		;_GUICtrlListView_ClickItem($hThumbnailView, 0, "left") 
		Common_SleepTime(1)	
		OpenSaveAsDlgFromFileMenu()
		Common_SetSaveAsFormat($SaveFormat_1[$i])
		SetSaveAsFileName($sTestResultPath & $TestCaseID)
		Common_SleepTime(15)
		If $FileFormat_1[$i] == ".htm" Or $FileFormat_1[$i] == ".psd" Or $FileFormat_1[$i] == ".png" Or $FileFormat_1[$i] == ".txt" Then
			If FileExists($sTestResultPath & $TestCaseID & $FileFormat_1[$i]) Then
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf				
		Else
			Local $bCompareFile = Common_CompareFile($sTestResultPath & $TestCaseID & $FileFormat_1[$i], $sCorrectResultPath & $TestCaseID & $FileFormat_1[$i])		
			Common_SleepTime(15)
			If $bCompareFile Then	
				Common_WriteLog($sPass, $TestCaseID,$sLogFileName,'')  
			Else
				Common_WriteLog($sFaile & $sErrorFunction ,$TestCaseID,$sLogFileName,'')   
			EndIf
		EndIf
		FileDelete($sFunctionFolderPath & 'HTML.htm')	
		Common_SwitchToFolderInRootDiskC($hPMHandle,$SaveAsFunctionName)
	Next
	Common_Close_PM($hPMHandle)	
EndFunc